const http = uni.$u.http
// post请求，用户登录
export const login = (params, config = {}) => http.post('/serviceUser/user/login', params, config)

//用户注册账号
export const register = (params, config = {}) => http.post('/serviceUser/user/register', params, config)

//用户修改头像
export const updateAvatar = (params, config = {}) => http.post('/serviceUser/user/updateAvatar', params, config)


//拿到所有商品列表
export const getGoodsList = (data = {}) => http.get('/serviceUser/app_goods/getGoodsList', data)


//添加商品
export const addGoods = (params, config = {}) => http.post('/serviceUser/app_goods/addGoods', params, config)

//根据商品类型查询商品
export const getGoodsByType = (data, config = {}) => http.get('/serviceUser/app_goods/getGoodsByType', data, config)

//根据id查询商品
export const getGoodsById = (data = {}) => http.get('/serviceUser/app_goods/getGoodsList', data)

//添加订单
export const addOrder = (params, config = {}) => http.post('/serviceUser/order/addOrder', params, config)

//获取余额
export const getBalance = (params, config = {}) => http.post('/serviceUser/user/getBalance', params, config)

//获取余额
export const addBalance = (params, config = {}) => http.post('/serviceUser/user/addBalance', params, config)


export const upNickName = (params, config = {}) => http.post('/serviceUser/user/upNickName', params, config)
export const upSex = (params, config = {}) => http.post('/serviceUser/user/upSex', params, config)
export const upBirthday = (params, config = {}) => http.post('/serviceUser/user/upBirthday', params, config)
export const upPassword = (params, config = {}) => http.post('/serviceUser/user/upPassword', params, config)



//上传动态
export const addSocial = (params, config = {}) => http.post('/serviceUser/social/addSocial', params, config)


//获取所有动态
export const getAllSocial = (params = {}) => http.get('/serviceUser/social/getAllSocial', params)
